package com.psy.counseling.aspect;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
 * <p>
 *  工具类
 * </p>
 *
 * @author 陈灿
 * @since 2022-06-03
 */
public class HttpContextUtils {

    private HttpContextUtils(){}
    public static HttpServletRequest getHttpServletRequest() {
        return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
    }
}
